// 员工用户管理页面

import {
  request,
  _post,
  _get,
  _put
} from '../request';

export function getMenber(data) {
  return _post({
    url: `crm/pt/emp-users/action/sub-list-page`,
    data,
  });
}
// 修改员工密码
export function modifyPassword(data) {
  return _post({
    url: `crm/pt/agent-users/action/edit-password`,
    data,
  });
}
// 获取员工的单个信息详情
export function getMenberDetail(data) {
  return _get({
    url: `crm/pt/agent-users/action/detail`,
    data,
  });
}

export function editMenber(data) {
  return _put({
    url: `crm/pt/emp-users/action/update`,
    data,
  });
}

export function addMenberData(data) {
  return _post({
    url: `crm/pt/emp-users/action/register`,
    data,
  });
}

export function operUser(data) {
  // 操作删除禁用
  return _put({
    url: `crm/pt/emp-users/action/operator`,
    data,
  });
}

// /

// 查询角色
export function getRoleCode(data) {
  return _get({
    url: `crm/pt/emp-users/action/role-list`,
    data,
  });
}

// 查询代理商
export function getAgent(data) {
  return _get({
    url: `crm/pt/agent-users/action/agent-names-list`,
    data,
  });
}
export function getAgentNew(data) {
  return _post({
    url: `crm/pt/agent-users/action/list-page`,
    data,
  });
}

// 分配员工
export function getAgentDispatch(data) {
  return _get({
    url: `crm/pt/emp-users/action/complain-process-emp-list`,
    data,
  });
}
export function resetPassword(data) {
  return _post({
    url: `crm/pt/agent-users/action/reset-password`,
    data,
  });
}

// 分页查询代理商
export function getAgentPage(data) {
  return _post({
    url: `crm/pt/agent-users/action/list-page`,
    data,
  });
}
// 查询单个代理商的详情
export function getAgentDetail(data) {
  return _get({
    url: `crm/pt/agent-users/action/detail`,
    data,
  });
}
// 新增代理商
export function addNewAgent(data) {
  return _post({
    url: `crm/pt/agent-users/action/create`,
    data,
  });
}
// 删除 禁用代理商
export function deleteAgent(data) {
  return _put({
    url: `crm/pt/agent-users/action/operator`,
    data,
  });
}

// 重置代理商密码

export function resetAgentPassword(data) {
  return _post({
    url: `crm/pt/agent-users/action/reset-password`,
    data,
  });
}

// 转正代理商
export function toFormalAgent(data) {
  return _post({
    url: `crm/pt/agent-users/action/trans-formal`,
    data,
  });
}
// 转临时代理商
export function totempAgent(data) {
  return _post({
    url: `crm/pt/agent-users/action/trans-intention`,
    data,
  });
}
//  编辑更新代理商
export function editAgent(data) {
  return _put({
    url: `crm/pt/agent-users/action/update`,
    data,
  });
}

// 获取终端客户

export function getAllTerminal(data, header) {
  return _post({
    url: `crm/pt/customerss/action/list-page`,
    data,
    header
  });
}
// 编辑终端客户
export function editTerminal(data) {
  return _put({
    url: `crm/pt/customerss/action/update`,
    data,
  });
}

// 查询单个终端客户

export function getTerminalDetail(data) {
  return _get({
    url: `crm/pt/customerss/action/detail`,
    data,
  });
}


// 新增终端客户
export function addTerminalDetail(data, header) {
  return _post({
    url: `crm/pt/customerss/action/create`,
    data,
    header
  });
}
// 新增联系人
export function addNewContactor(data) {
  return _post({
    url: `crm/pt/agent-link-users/action/create`,
    data,
  });
}
// 查询联系人
export function getContactorList(data) {
  return _get({
    url: `crm/pt/agent-link-users/action/list?agentId=${data.agentUserId}`,
  });
}
// 删除联系人
export function deleteContactor(data, header) {
  return _put({
    url: `crm/pv/agent-link-users/action/operator`,
    data,
    header
  });
}
// 编辑联系人
export function editContactor(data) {
  return _put({
    url: `crm/pt/agent-link-users/action/update`,
    data,
  });
}
// 获取联系人详情
export function getContactDetail(data) {
  return _get({
    url: `crm/pt/agent-link-users/action/detail`,
    data,
  });
}